using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._StandardFeatureAnalysisTools._SummarizeData
{
    /// <summary>
    /// <para>Summarize Within</para>
    /// <para>Finds the point, line, or polygon features (or portions of these features) that are within the boundaries of polygons in another layer.</para>
    /// <para>查找位于另一图层中面边界内的点、线或面要素（或这些要素的一部分）。</para>
    /// </summary>    
    [DisplayName("Summarize Within")]
    public class SummarizeWithin : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SummarizeWithin()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_sumWithinLayer">
        /// <para>Input Polygons</para>
        /// <para>Features, or portions of features, in the input summary features that fall within the boundaries of these polygons will be summarized.</para>
        /// <para>将汇总输入汇总要素中位于这些面边界内的要素或要素的一部分。</para>
        /// </param>
        /// <param name="_summaryLayer">
        /// <para>Input Summary Features</para>
        /// <para>The point, line, or polygon features that will be summarized for each input polygon.</para>
        /// <para>将为每个输入面汇总的点、线或面要素。</para>
        /// </param>
        /// <param name="_outputName">
        /// <para>Output Name</para>
        /// <para>The name of the output layer to create on your portal.</para>
        /// <para>要在门户上创建的输出图层的名称。</para>
        /// </param>
        public SummarizeWithin(object _sumWithinLayer, object _summaryLayer, object _outputName)
        {
            this._sumWithinLayer = _sumWithinLayer;
            this._summaryLayer = _summaryLayer;
            this._outputName = _outputName;
        }
        public override string ToolboxName => "Standard Feature Analysis Tools";

        public override string ToolName => "Summarize Within";

        public override string CallName => "sfa.SummarizeWithin";

        public override List<string> AcceptEnvironments => ["extent"];

        public override object[] ParameterInfo => [_sumWithinLayer, _summaryLayer, _outputName, _sumShape.GetGPValue(), _shapeUnits.GetGPValue(), _summaryFields, _groupByField, _minorityMajority.GetGPValue(), _percentShape.GetGPValue(), _outputLayer, _groupBySummaryLayer];

        /// <summary>
        /// <para>Input Polygons</para>
        /// <para>Features, or portions of features, in the input summary features that fall within the boundaries of these polygons will be summarized.</para>
        /// <para>将汇总输入汇总要素中位于这些面边界内的要素或要素的一部分。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Polygons")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _sumWithinLayer { get; set; }


        /// <summary>
        /// <para>Input Summary Features</para>
        /// <para>The point, line, or polygon features that will be summarized for each input polygon.</para>
        /// <para>将为每个输入面汇总的点、线或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Summary Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _summaryLayer { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para>The name of the output layer to create on your portal.</para>
        /// <para>要在门户上创建的输出图层的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputName { get; set; }


        /// <summary>
        /// <para>Add shape summary attributes</para>
        /// <para><xdoc>
        ///   <para>Calculate statistics based on the shape of the input summary features, such as the length of lines or areas of polygons of the input summary features within each input polygon.
        ///   <bulletList>
        ///     <bullet_item>Checked—Calculate the shape summary attributes. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Do not calculate the shape summary attributes.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>根据输入汇总要素的形状（例如每个输入面内输入汇总要素的线长度或面面积）计算统计数据。
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 计算形状汇总属性。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 （Unchecked） - 不计算形状汇总属性。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add shape summary attributes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _sumShape_value _sumShape { get; set; } = _sumShape_value._true;

        public enum _sumShape_value
        {
            /// <summary>
            /// <para>ADD_SHAPE_SUM</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADD_SHAPE_SUM")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SHAPE_SUM</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SHAPE_SUM")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Shape Unit</para>
        /// <para><xdoc>
        ///   <para>If summarizing the shape of the input summary features, specify the units of the shape summary.</para>
        ///   <para>When the input summary features are polygons, the valid options are acres, hectares, square meters, square kilometers, square feet, square yards, and square miles.</para>
        ///   <para>When the input summary features are lines, the valid options are meters, kilometers, feet, yards, and miles.</para>
        ///   <bulletList>
        ///     <bullet_item>Miles—Miles</bullet_item><para/>
        ///     <bullet_item>Feet—Feet</bullet_item><para/>
        ///     <bullet_item>Kilometers—Kilometers</bullet_item><para/>
        ///     <bullet_item>Meters—Meters</bullet_item><para/>
        ///     <bullet_item>Yards—Yards</bullet_item><para/>
        ///     <bullet_item>Acres—Acres</bullet_item><para/>
        ///     <bullet_item>Hectares—Hectares</bullet_item><para/>
        ///     <bullet_item>Square meters—Square meters</bullet_item><para/>
        ///     <bullet_item>Square kilometers—Square kilometers</bullet_item><para/>
        ///     <bullet_item>Square feet—Square feet</bullet_item><para/>
        ///     <bullet_item>Square yards—Square yards</bullet_item><para/>
        ///     <bullet_item>Square miles—Square miles</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果汇总输入汇总要素的形状，请指定形状汇总的单位。</para>
        ///   <para>当输入汇总要素为面时，有效选项为英亩、公顷、平方米、平方公里、平方英尺、平方码和平方英里。</para>
        ///   <para>当输入汇总要素为线时，有效选项为米、千米、英尺、码和英里。</para>
        ///   <bulletList>
        ///     <bullet_item>英里 - 英里</bullet_item><para/>
        ///     <bullet_item>英尺 - 英尺</bullet_item><para/>
        ///     <bullet_item>公里 - 公里</bullet_item><para/>
        ///     <bullet_item>米 - 米</bullet_item><para/>
        ///     <bullet_item>码 - 码</bullet_item><para/>
        ///     <bullet_item>英亩 - 英亩</bullet_item><para/>
        ///     <bullet_item>公顷 - 公顷</bullet_item><para/>
        ///     <bullet_item>平方米 - 平方米</bullet_item><para/>
        ///     <bullet_item>平方公里 - 平方公里</bullet_item><para/>
        ///     <bullet_item>平方英尺 - 平方英尺</bullet_item><para/>
        ///     <bullet_item>平方码 - 平方码</bullet_item><para/>
        ///     <bullet_item>平方英里 - 平方英里</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Shape Unit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _shapeUnits_value? _shapeUnits { get; set; } = null;

        public enum _shapeUnits_value
        {
            /// <summary>
            /// <para>Acres</para>
            /// <para>Acres—Acres</para>
            /// <para>英亩 - 英亩</para>
            /// </summary>
            [Description("Acres")]
            [GPEnumValue("ACRES")]
            _ACRES,

            /// <summary>
            /// <para>Hectares</para>
            /// <para>Hectares—Hectares</para>
            /// <para>公顷 - 公顷</para>
            /// </summary>
            [Description("Hectares")]
            [GPEnumValue("HECTARES")]
            _HECTARES,

            /// <summary>
            /// <para>Square meters</para>
            /// <para>Square meters—Square meters</para>
            /// <para>平方米 - 平方米</para>
            /// </summary>
            [Description("Square meters")]
            [GPEnumValue("SQUAREMETERS")]
            _SQUAREMETERS,

            /// <summary>
            /// <para>Square kilometers</para>
            /// <para>Square kilometers—Square kilometers</para>
            /// <para>平方公里 - 平方公里</para>
            /// </summary>
            [Description("Square kilometers")]
            [GPEnumValue("SQUAREKILOMETERS")]
            _SQUAREKILOMETERS,

            /// <summary>
            /// <para>Square feet</para>
            /// <para>Square feet—Square feet</para>
            /// <para>平方英尺 - 平方英尺</para>
            /// </summary>
            [Description("Square feet")]
            [GPEnumValue("SQUAREFEET")]
            _SQUAREFEET,

            /// <summary>
            /// <para>Square yards</para>
            /// <para>Square yards—Square yards</para>
            /// <para>平方码 - 平方码</para>
            /// </summary>
            [Description("Square yards")]
            [GPEnumValue("SQUAREYARDS")]
            _SQUAREYARDS,

            /// <summary>
            /// <para>Square miles</para>
            /// <para>Square miles—Square miles</para>
            /// <para>平方英里 - 平方英里</para>
            /// </summary>
            [Description("Square miles")]
            [GPEnumValue("SQUAREMILES")]
            _SQUAREMILES,

            /// <summary>
            /// <para>Meters</para>
            /// <para>Meters—Meters</para>
            /// <para>米 - 米</para>
            /// </summary>
            [Description("Meters")]
            [GPEnumValue("METERS")]
            _METERS,

            /// <summary>
            /// <para>Kilometers</para>
            /// <para>Kilometers—Kilometers</para>
            /// <para>公里 - 公里</para>
            /// </summary>
            [Description("Kilometers")]
            [GPEnumValue("KILOMETERS")]
            _KILOMETERS,

            /// <summary>
            /// <para>Feet</para>
            /// <para>Feet—Feet</para>
            /// <para>英尺 - 英尺</para>
            /// </summary>
            [Description("Feet")]
            [GPEnumValue("FEET")]
            _FEET,

            /// <summary>
            /// <para>Yards</para>
            /// <para>Yards—Yards</para>
            /// <para>码 - 码</para>
            /// </summary>
            [Description("Yards")]
            [GPEnumValue("YARDS")]
            _YARDS,

            /// <summary>
            /// <para>Miles</para>
            /// <para>Miles—Miles</para>
            /// <para>英里 - 英里</para>
            /// </summary>
            [Description("Miles")]
            [GPEnumValue("MILES")]
            _MILES,

        }

        /// <summary>
        /// <para>Summary Fields</para>
        /// <para><xdoc>
        ///   <para>A list of field names and statistical summary type that you wish to calculate for all points within each polygon. The count of points within each polygon is always returned. The following statistic types are supported:
        ///   <bulletList>
        ///     <bullet_item>Sum—The total value.  </bullet_item><para/>
        ///     <bullet_item>Minimum—The smallest value.  </bullet_item><para/>
        ///     <bullet_item>Max—The largest value.  </bullet_item><para/>
        ///     <bullet_item>Mean—The average or mean value.  </bullet_item><para/>
        ///     <bullet_item>Standard deviation—The standard deviation.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>要为每个面内的所有点计算的字段名称和统计汇总类型的列表。始终返回每个多边形内的点数。支持以下统计信息类型：
        ///   <bulletList>
        ///     <bullet_item>Sum - 总值。</bullet_item><para/>
        ///     <bullet_item>最小值 - 最小值。</bullet_item><para/>
        ///     <bullet_item>Max - 最大值。</bullet_item><para/>
        ///     <bullet_item>均值 - 平均值或平均值。</bullet_item><para/>
        ///     <bullet_item>标准差 （Standard deviation） - 标准差。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _summaryFields { get; set; } = null;


        /// <summary>
        /// <para>Group By Field</para>
        /// <para>This is a field from the input summary features that you can use to calculate statistics separately for each unique attribute value. For example, suppose the input summary features contain point locations of businesses that store hazardous materials, and one of the fields is HazardClass containing codes that describe the type of hazardous material stored. To calculate summaries by each unique value of HazardClass, use it as the group by field.</para>
        /// <para>这是输入汇总要素中的一个字段，可用于单独计算每个唯一属性值的统计数据。例如，假设输入汇总要素包含存储危险材料的企业的点位置，其中一个字段是 HazardClass，其中包含描述存储的危险材料类型的代码。若要按 HazardClass 的每个唯一值计算摘要，请将其用作分组依据字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Group By Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _groupByField { get; set; } = null;


        /// <summary>
        /// <para>Add minority and majority attributes</para>
        /// <para><xdoc>
        ///   <para>This only applies when using a group by field. If checked, the minority (least dominant) or the majority (most dominant) attribute values for each group field within each boundary are calculated. Two new fields are added to the output layer prefixed with Majority_ and Minority_.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not add minority and majority fields. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—Add minority and majority fields.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>这仅适用于使用“分组依据”字段的情况。如果选中该选项，则将计算每个边界内每个组字段的少数（最主要）或多数（最主要）属性值。两个新字段将添加到以 Majority_ 和 Minority_ 为前缀的输出图层。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不添加少数和多数字段。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 添加少数和多数字段。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add minority and majority attributes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _minorityMajority_value _minorityMajority { get; set; } = _minorityMajority_value._false;

        public enum _minorityMajority_value
        {
            /// <summary>
            /// <para>ADD_MIN_MAJ</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADD_MIN_MAJ")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_MIN_MAJ</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_MIN_MAJ")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Add group percentages</para>
        /// <para><xdoc>
        ///   <para>This only applies when using a group by field. If checked, the percentage of each unique group value is calculated for each input polygon.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not add percentage fields. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—Add percentage fields.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>这仅适用于使用“分组依据”字段的情况。如果选中，则会计算每个输入面的每个唯一组值的百分比。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不添加百分比字段。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 添加百分比字段。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add group percentages")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _percentShape_value _percentShape { get; set; } = _percentShape_value._false;

        public enum _percentShape_value
        {
            /// <summary>
            /// <para>ADD_PERCENT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADD_PERCENT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_PERCENT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_PERCENT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Feature Service</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Service")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputLayer { get; set; }


        /// <summary>
        /// <para>Output Group Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Group Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _groupBySummaryLayer { get; set; }


        public SummarizeWithin SetEnv(object extent = null)
        {
            base.SetEnv(extent: extent);
            return this;
        }

    }

}